#ifndef _ICOMBOBOARD_H_
#define _ICOMBOBOARD_H_

#include <BArray>
#include <BButton>
#include <BScrollArea>
#include <BComboBox>
#include <BComboItem>

namespace BWE
{
	class IComboBoard : public BScrollArea
	{
	public:
		IComboBoard(BArray<BComboItemHolder>* items, BComboBox* comboBox);
		~IComboBoard();

		void freshItemRects();

		void slotArrowChecked(BObject* object, const BValue& value);

		virtual BSize sizeHint() const;

	protected:
		virtual void scrollArea();

	protected:
		virtual void resizeEvent(const BEvent& event);

		virtual void styleEvent(const BEvent& event);
		virtual void freshEvent(const BEvent& event);
		virtual void paintEvent(const BEvent& event);

		virtual void keyDownEvent(const BKeyEvent& keyEvent);

		virtual void mouseEnterEvent(const BMouseEvent& mouseEvent);
		virtual void mouseLeaveEvent(const BMouseEvent& mouseEvent);

		virtual void mouseClickEvent(const BMouseEvent& mouseEvent);
		virtual void mouseMoveEvent(const BMouseEvent& mouseEvent);

	public:
		BComboBox*			host;
		BHolder<BButton>		arrow;
		BArray<BComboItemHolder>*	items;

		mutable bool		dirty;
		BSize				iconSize;
		int					itemSpace;
		BComboItem*			hoveredItem;
		BComboItem*			pressedItem;
		BSize				contentSize;
		int					showBegin;
		int					showEnd;


	};
}
#endif
